<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script>
    var xml = new XMLHttpRequest()
    var user = {
      username: 'admin',
      password: '123456'
    }
    xml.open('post', 'http://127.0.0.1:8888/api/private/v1/login')
    xml.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xml.send("username=admin&password=123456")
    xml.onreadystatechange = function () {
      if (this.status == 200) {
        console.log(this.responseText);
      }
    }
  </script>
</body>

</html>